n = eval(input())
i = 1
j = 2
s = 0
list1 = [0] * n
list1[0] += 1
for k in range (1,1000):
    i += j
    if i > n:
        i = i % n
        if i == 0:
            list1[n - 1] += 1
        else:
            list1[i - 1] += 1
    j += 1
for k in range(0,n):
    if list1[k] == 0:
        print(k + 1)
        s += 1
if s == 0:
    print(0)